import Vuex from 'vuex'

export default  Vuex.createStore({
    state() {
        return {
            b: false,
            apiMap: new Map(),
            apiObj: {'api/api2': false}
        }
    },
    mutations: {
        SET_APIMAP(state, value) {
            state.apiMap.set(value.key, value.value)
            state.b = !state.b
            console.log('SET_APIMAP', state, value, state.b);
        },
        SET_APIOBJ(state, value) {
            console.log('SET_APIOBJ', state, value);
            state.apiObj[value.key] = value.value
            state.b = !state.b
        },
    }
})